package com.pcbly.web.bean.news;

import com.pcbly.web.bean.AbstractBaseBean;
import com.pcbly.web.bean.TreeHelper;



abstract class AbstractTreeEntityBean extends AbstractBaseBean implements TreeEntityBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7481680491564453480L;

	public AbstractTreeEntityBean() {
	}

	public boolean isRoot() {
		return getParent() == null;
	}

	public boolean isLeaf() {
		return getChildren() == null || getChildren().size() == 0;
	}

	public boolean checkDeadLock(TreeEntityBean parent) {
		return TreeHelper.checkDeadLock(this, parent);
	}

}
